package cn.liangxxhu.rocketmq.param;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

@Data
/**
 * ES 文档基类，提供通用主键、创建/更新时间与逻辑删除标识。
 */
public abstract class BaseDocument {
    @Id
    private String id;
    
    @Field(name = "created_at", type = FieldType.Date)
    private LocalDateTime createdAt = LocalDateTime.now();
    
    @Field(name = "updated_at", type = FieldType.Date)
    private LocalDateTime updatedAt = LocalDateTime.now();
    
    @Field(name = "is_deleted", type = FieldType.Boolean)
    private boolean deleted = false;
}
